package com.soft.app.ruanba;

import java.util.concurrent.LinkedBlockingQueue;

import com.soft.webharvest.util.ConfigFactory;

public class FileToDownload {

	private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(Main.class);
	public static final String CONFIG = "ruanba.properties";
	public static final String APPCODE = "ruan";
	public static boolean local;
	public static boolean running;
	public static String prefix;
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		ConfigFactory.Config cconfig = ConfigFactory.getConfig("ruanba.properties");
		String downloadFileDir = cconfig.getProperty((new StringBuilder()).append(prefix).append("downloadFileDir").toString());
		String xmlFileDir = cconfig.getProperty((new StringBuilder()).append(prefix).append("xmlFileDir").toString());
		//String xmlFile = xmlFileDir + "\\ruan8_cate_11.xml";
		String xmlFile = xmlFileDir + "\\ruan8_cate_9.xml";
		FileDownloadJob job = new FileDownloadJob(downloadFileDir, xmlFile);
		job.excute();
		if (org.apache.commons.lang.StringUtils.isBlank(downloadFileDir))
		{
			log.info("downloadFileDir is null");
			System.exit(-1);
		}
		java.util.concurrent.LinkedBlockingQueue queue = new LinkedBlockingQueue(100);
		//ParseJob pj = new ParseJob(queue, DestDir);
		//pj.start();

	}
	
	static 
	{
		String os = System.getProperty("os.name");
		local = !"Linux".equals(os);
		StringBuilder builder = new StringBuilder();
		builder.append(local ? "local" : "server").append(".").append("ruan").append(".");
		prefix = builder.toString();
	}

}
